<?php

namespace app\index\controller;

class Doc
{

    public function __construct()
    {
        if (! config('app_debug')) {
            echo 'no access';die();
        }
    }

    public function index()
    {
        return view('/index');
    }

    public function getDoc()
    {
        $swagger = \Swagger\scan(VENDOR_PATH.'zircote/swagger-php/Examples/petstore.swagger.io');
        header('Content-Type: application/json');
        echo $swagger;
    }

}
